package com.cn.ycy.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * gson  工具类
 */
public class GsonUtil {

  private static final Gson BASE_GSON = new GsonBuilder().create();

//  public static void getMap(String json,String json, Class<T> classOfT) {
//    BASE_GSON.fromJson(json, )
//  }

  public static <T> T GsonToBean(String gsonString, Class<T> cls) {
    T t = null;
    if (gsonString != null) {
      //传入json对象和对象类型,将json转成对象
      t = BASE_GSON.fromJson(gsonString, cls);
    }
    return t;
  }

}

